@extends('layouts.admin')
      @section('xgshopym')
      <li><a href="{{URL('admin/shopym')}}"> 编辑商品</a></li>
      <li><a href="{{URL('admin/shopym/add')}}"> 增加商品</a></li>
      @endsection
      @section('xgleibie')
      <li><a href="{{url('admin/leibie')}}">编辑类别</a></li>
      <li><a href="{{url('admin/leibie/add')}}" > 增加类别</a></li>
      @endsection
      @section('xgvip')
      <li><a href="{{url('admin/user')}}"><i class="fa fa-user"></i><span>会员管理</span></a></li>
      @endsection
      @section('bjdingdan')
      <li class="active"><a href="{{url('admin/dingdan')}}"><i class="fa fa fa-cube"></i> <span> 编辑订单</span> </a></li>
      @endsection
      @section('xggonggao')
      <li><a href="{{URL('admin/gonggao')}}"> 编辑公告</a></li>
      <li><a href="{{URL('admin/gonggao/add')}}"> 增加公告</a></li>
      @endsection
      @section('page-wrapper')
            <div class="content">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">订单详情</h4>
                    </div>
                </div>
     
                <div class="row">
                    <div class="col-md-12">
                        <div class="card-box">
                          <h4 class="card-title" style="color: #009efb;cursor:pointer;" ><i class="fa fa-hand-o-left" aria-hidden="true"  style="margin-right: 3px;"></i><a onclick="javascript:history.back(-1);" >返回</a></h4>
                            <h4 class="card-title">
                             订单号：@foreach($booknumber as $booknum){{$booknum}}@endforeach
                            </h4>
                           
                            <div class="row">
                                <div class="col-md-12">
                                  <div class="table-responsive">
                                    <table class="table table-border table-striped custom-table mb-0">
                                       <form action="{{url('admin/xgdingdan/up')}}" method="post" onsubmit="return lbyz(this)">
                                      <thead>
                                        <tr>
                                          <th>商品名称</th>
                                         
                                          <th>市场价</th>
                                          <th >折扣</th>
                                          <th >数量</th>

                                        </tr>
                                      </thead>
                                      <tbody>
                                        @foreach($bookname as $book)
                                        @if($book!=null)
                                        <tr>
                                          <td>{{$book}}</td>
                                          <td>99</td>
                                          <td>6</td>
                                          <td>1</td>
                                          
                                        </tr>
                                        @endif
                                        @endforeach

                                      </tbody>
           
                                    </table>
                                  </div>
                                  </div>
                             </div>
                             <br><br>
                            <form action="#">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">订单状态</label>
                                            <div class="col-md-9">
                                              
                                              @if($result->zt == '已收款')
                                              <label class="form-checkbox-inline col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_male" value="已收款" checked>&nbsp;已收款
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_female" value="已发货" class="selectAll">&nbsp;已发货
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
													                      <input type="checkbox" name="zt" id="gender_female" value="已签收" class="selectAll">&nbsp;已签收
                                              </label>
                                              @elseif($result->zt == '已发货')
                                              <label class="form-checkbox-inline col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_male" value="已收款" class="selectAll">&nbsp;已收款
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_female" value="已发货" checked>&nbsp;已发货
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
													                      <input type="checkbox" name="zt" id="gender_female" value="已签收" class="selectAll">&nbsp;已签收
                                              </label>
                                              @elseif($result->zt == '已签收')
                                              <label class="form-checkbox-inline col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_male" value="已收款" class="selectAll">&nbsp;已收款
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_female" value="已发货" class="selectAll">&nbsp;已发货
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
													                      <input type="checkbox" name="zt" id="gender_female" value="已签收" checked>&nbsp;已签收
                                              </label>
                                              @else
                                              <label class="form-checkbox-inline col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_male" value="已收款" >&nbsp;已收款
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
                                                <input  type="checkbox" name="zt" id="gender_female" value="已发货" >&nbsp;已发货
                                              </label>
                                                &nbsp;&nbsp;
                                              <label class="form-checkbox-inline  col-form-label">
													                      <input type="checkbox" name="zt" id="gender_female" value="已签收" >&nbsp;已签收
                                              </label>
                                              @endif
                                            </div>
                                        </div>
                                        
                                    </div>
                                                  
                                        <div class="form-group row">
                                            <label class="col-md-12 col-form-label form-control" style=" border-color: transparent;" >总计费用:&nbsp;&nbsp;&nbsp;&nbsp;{{$result->total}}</label>
                                           
                                        </div>
                                    
                                </div>
                                <h4 class="card-title">订单地址</h4>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">下单人</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" value="{{$result->xiadanren}}" name="xiadanren">
                                            </div>
                                        </div>
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">收货地址</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" value="{{$result->address}}" name="address">
                                            </div>
                                        </div>
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">电话</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" value="{{$result->tel}}" name="tel">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">收货人</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" value="{{$result->shouhuoren}}" name="shouhuoren">
                                            </div>
                                        </div>
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">邮编</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" value="{{$result->youbian}}" name="youbian">
                                            </div>
                                        </div>
                                        <div class="form-group row">
                                            <label class="col-md-3 col-form-label">送货方式</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" value="{{$result->shff}}" name="shff">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                  

                                {{csrf_field()}} 
                                <input type="hidden" name="orderid" value="{{$result->orderid}}"/></td>
                                <div class="text-right">
                                    <button type="submit" class="btn btn-primary">修改</button>
                                </div>
                            </form>                           
                        </div>
         
                       </div>    
                        </div>
<script language="javascript">
      function lbyz(fom){
        if(fom.xiadanren.value==''){
          alert('请输入下单人');
          fom.xiadanren.select();
          return false;
          }
        if(fom.address.value==''){
          alert('请输入收货地址');
          fom.address.select();
          return false;
          }
        if(fom.tel.value==''){
        alert('请输入电话');
        fom.tel.select();
        return false;
        }
        if(fom.shouhuoren.value==''){
        alert('请输入收货人');
        fom.shouhuoren.select();
        return false;
        }
        if(fom.youbian.value==''){
        alert('请输入邮编');
        fom.youbian.select();
        return false;
        }
        if(fom.shff.value==''){
        alert('请输入送货方式');
        fom.shff.select();
        return false;
        }
        }
</script>

<!-- checkbox添加点击事件 -->
<script src="{{URL::asset('root\js/jquery-3.2.1.min.js')}}"></script>
<script type="text/javascript">
  $(document).ready(function(){
    $(".selectAll").click(function(){   
      if($(this).attr("checked")=="checked"){
        $(":checkbox").not($(this)).attr("checked","checked");}
       else{
         $(":checkbox").not($(this)).removeAttr("checked");
      }
      });
    }); 
  </script>                   
@endsection            
         
    